package view.pane;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JPanel;

import view.Gui;
import controller.human.Action;
import controller.human.User;

@SuppressWarnings("serial")
public class NightPaneSecond extends JPanel {
	Gui gui;
	User actor;
	User target;
	Action action;
	
	public NightPaneSecond(Gui gui, User actor, User target) {
		this.gui = gui;
		this.actor = actor;
		this.target = target;
		
		this.add(new JButton(new AbstractAction("Mute") {
			public void actionPerformed(ActionEvent arg0) {
				action = Action.Mute;
				nightPaneSecond();
			}
		}));
		this.add(new JButton(new AbstractAction("Vote") {
			public void actionPerformed(ActionEvent arg0) {
				action = Action.Hand;
				nightPaneSecond();
			}
		}));
	}

	private void nightPaneSecond() {
		gui.nightAction(actor, target, action);
	}
}
